package com.bowlong.net.proto.gen.proto.demo;

import static com.bowlong.net.proto.gen.B2G.DATA;
import static com.bowlong.net.proto.gen.B2G.SERVER;

import java.util.List;

import com.bowlong.io.FileEx;
import com.bowlong.net.proto.gen.B2Class;
import com.bowlong.net.proto.gen.B2Field;
import com.bowlong.net.proto.gen.B2G;
import com.bowlong.net.proto.gen.B2Method;
import com.bowlong.net.proto.gen.B2Param;
import com.bowlong.net.proto.gen.Bio2GCSharp;
import com.bowlong.net.proto.gen.Bio2GCSharpCmd;
import com.bowlong.net.proto.gen.Bio2GCSharpNative;
import com.bowlong.net.proto.gen.Bio2GJava;

/**
 * 客户端通信接口
 * 
 * @author niko
 * 
 */
@B2Class(namespace = "game")
public class GameService {
	public static void main(String[] args) throws Exception {
		Class<?> c = GameService.class;
		boolean src = FileEx.exists("src");
		Bio2GJava.b2g(c, src);
		Bio2GCSharp.b2g(c, src);
		Bio2GCSharpNative.b2g(c, src);
		Bio2GCSharpCmd.b2g(c, src);
	}


	// ///////////////////////////////////////////////////

	// @B2Class(type = DATA, remark = "OutBytes")
	// class OutBytes {
	// public byte[] val;
	// }

	@B2Class(type = DATA, remark = "返回值")
	class ReturnStatus {
		public int succ;
		public String msg;
	}

	@B2Class(type = B2G.DATA, remark = "消息类型", constant = true)
	class SuccType {
		@B2Field(remark = "成功", def = "0")
		int TRUE = 0;

		// --------异常信息(具有文字对应)
		@B2Field(remark = "服务器异常信息", def = "-1")
		int Error = -1;

		@B2Field(remark = "离线", def = "-2")
		int OFFLINE = -2;

		@B2Field(remark = "版本错误", def = "-3")
		int VER_FAILE = -3;

		@B2Field(remark = "在其他地方登录", def = "-4")
		int OTHER_LOGIN = -4;

		@B2Field(remark = "封号", def = "-5")
		int SCREEN = -5;

		@B2Field(remark = "退出游戏", def = "-6")
		int EXIT = -6;

		@B2Field(remark = "禁言", def = "-7")
		int Shield_Chat = -7;

		@B2Field(remark = "禁邮件", def = "-8")
		int Shield_Mail = -8;

		@B2Field(remark = "禁登陆", def = "-9")
		int Shield_Login = -9;

		@B2Field(remark = "禁设备", def = "-11")
		int Shield_Device = -11;

		// --------通知信息
		@B2Field(remark = "结束禁言", def = "3")
		int END_GAG = 3;

		@B2Field(remark = "提示信息", def = "-8")
		int ALERT = 4;
	}

	@B2Class(type = B2G.DATA, remark = "同步类型", constant = true)
	class SyncType {
		@B2Field(remark = "同步聊天", def = "1")
		int SyncChat = 1;

		@B2Field(remark = "同步邮件", def = "2")
		int SyncMail = 2;

		@B2Field(remark = "同步英雄", def = "3")
		int SyncHero = 3;

		@B2Field(remark = "同步道具", def = "4")
		int SyncUserBackpack = 4;

		@B2Field(remark = "同步用户基本信息", def = "5")
		int SyncUserInfo = 5;

		@B2Field(remark = "同步用户充值信息", def = "6")
		int SyncPayInfo = 6;
	}

	@B2Class(type = B2G.DATA, remark = "语言", constant = true)
	class LanguageType {
		@B2Field(remark = "简体中文", def = "CHS")
		String CHS = "CHS";

		@B2Field(remark = "英文", def = "EN")
		String EN = "EN";
	}

	@B2Class(type = B2G.DATA, remark = "联盟事件类型", constant = true)
	class AllianceEventType {
		@B2Field(remark = "申请加入", def = "1")
		int Request_Message = 1;
	}

	@B2Class(type = B2G.DATA, remark = "资源比例", constant = true)
	class PerType {
		@B2Field(remark = "10%", def = "1")
		int P10 = 1;
		@B2Field(remark = "50%", def = "2")
		int P50 = 2;
		@B2Field(remark = "100%", def = "3")
		int P100 = 3;
	}

	@B2Class(type = B2G.DATA, remark = "消耗方式", constant = true)
	class ExpendType {

		@B2Field(remark = "资源", def = "1")
		int RESOURCE = 1;

		@B2Field(remark = "宝石", def = "2")
		int DIAMOND = 2;
	}

	@B2Class(type = B2G.DATA, remark = "英雄技能位置", constant = true)
	class HeroSkillLocation {
		@B2Field(remark = "主技能", def = "1")
		int Main = 1;

		@B2Field(remark = "副技能", def = "2")
		int Deputy = 2;

		@B2Field(remark = "抽取的技能", def = "10")
		int Siphon = 10;
	}

	@B2Class(type = B2G.DATA, remark = "修炼类型", constant = true)
	class PracticeType {
		@B2Field(remark = "修炼生命", def = "1")
		int PH = 1;

		@B2Field(remark = "修炼攻击", def = "2")
		int ATTACK = 2;
	}

	@B2Class(type = B2G.DATA, remark = "资源类型", constant = true)
	class ResourceType {
		@B2Field(remark = "宝石", def = "Diamonds")
		String DIAMOND = "Diamond";

		@B2Field(remark = "金币", def = "Gold")
		String GOLD = "Gold";

		@B2Field(remark = "水", def = "Elixir")
		String WATER = "Elixir";

		@B2Field(remark = "体力", def = "Energy")
		String ENERGY = "Energy";

		@B2Field(remark = "修炼点", def = "Practice_Point")
		String PRACTICE_POINT = "Practice_Point";
	}

	@B2Class(type = B2G.DATA, remark = "服务器状态", constant = true)
	class ServerStatus {
		@B2Field(remark = "维护", def = "-6")
		int MAINTAIN = -6;

		@B2Field(remark = "推荐", def = "1")
		int RECOMMEND = 1;

		@B2Field(remark = "新服", def = "2")
		int NEWSERVER = 2;

		@B2Field(remark = "爆满", def = "3")
		int HOUSEFULL = 3;

		@B2Field(remark = "良好", def = "4")
		int SMOOTH = 4;
	}

	@B2Class(type = B2G.DATA, remark = "限制类型", constant = true)
	class LimitType {
		@B2Field(remark = "登陆", def = "1")
		int LOGIN = 1;

		@B2Field(remark = "设备", def = "2")
		int DEVICE = 2;

		@B2Field(remark = "邮件", def = "3")
		int MAIL = 3;

		@B2Field(remark = "聊天", def = "4")
		int CHAT = 4;
	}

	@B2Class(type = B2G.DATA, remark = "渠道", constant = true)
	class ChannelType {
		@B2Field(remark = "系统", def = "system")
		String SYSTEM = "system";

		@B2Field(remark = "安卓.360", def = "android.360")
		String Android360 = "android.360";

		@B2Field(remark = "安卓.91", def = "android.91")
		String Android91 = "android.91";

		@B2Field(remark = "安卓.移动cm", def = "android.cm")
		String AndroidCm = "android.cm";

		@B2Field(remark = "安卓.当乐", def = "android.d")
		String AndroidDJoys = "android.d";

		@B2Field(remark = "安卓.机锋", def = "android.gfan")
		String AndroidGFan = "android.gfan";

		@B2Field(remark = "安卓.机锋", def = "android.google")
		String AndroidGoogle = "android.google";

		@B2Field(remark = "安卓.小米", def = "android.mi")
		String AndroidMi = "android.mi";

		@B2Field(remark = "安卓.移动mm", def = "android.mm")
		String AndroidMm = "android.mm";

		@B2Field(remark = "安卓.uc", def = "android.uc")
		String AndroidUc = "android.uc";

		// //////
		@B2Field(remark = "ios 25pp", def = "ios.25pp")
		String Ios25pp = "ios.25pp";

		@B2Field(remark = "ios 91", def = "ios.91")
		String Ios91 = "ios.91";

		@B2Field(remark = "ios apple", def = "ios.apple")
		String IosApple = "ios.apple";

		@B2Field(remark = "ios uc", def = "ios.uc")
		String IosUc = "ios.uc";

		@B2Field(remark = "sojoys", def = "sojoys")
		String Sojoys = "sojoys";

		@B2Field(remark = "无", def = "none")
		String NONE = "none";
	}

	@B2Class(type = B2G.DATA, remark = "地物类型", constant = true)
	class FeatureType {
		@B2Field(remark = "建筑", def = "1")
		int BUILDING = 1;

		@B2Field(remark = "障碍", def = "2")
		int OBSTACLE = 2;

		@B2Field(remark = "装饰", def = "3")
		int DECO = 3;

		@B2Field(remark = "陷阱", def = "4")
		int TRAP = 4;
	}

	@B2Class(type = B2G.DATA, remark = "阵营类型", constant = true)
	class CampType {
		@B2Field(remark = "进攻方", def = "1")
		int ATTACK = 1;

		@B2Field(remark = "防御方", def = "2")
		int DEFENSE = 2;
	}

	@B2Class(type = B2G.DATA, remark = "英雄状态", constant = true)
	class HeroStatus {
		@B2Field(remark = "开始工作", def = "1")
		int STARTWORK = 1;

		@B2Field(remark = "停止工作", def = "2")
		int STOPWORK = 2;
	}

	@B2Class(type = B2G.DATA, remark = "目标类型", constant = true)
	class TargertType {
		@B2Field(remark = "开始工作", def = "1")
		int Random = 1;

		@B2Field(remark = "指定", def = "2")
		int Assign = 2;

		@B2Field(remark = "副本", def = "3")
		int Duplicate = 3;
	}

	@B2Class(type = B2G.DATA, remark = "附件类型", constant = true)
	class AttachmentType {
		@B2Field(remark = "道具", def = "1")
		int Props = 1;

		@B2Field(remark = "宝石", def = "2")
		int DIAMOND = 2;

		@B2Field(remark = "金币", def = "3")
		int GOLD = 3;

		@B2Field(remark = "水", def = "4")
		int WATER = 4;

		@B2Field(remark = "用户经验", def = "5")
		int USER_EXP = 5;

		@B2Field(remark = "英雄卡", def = "6")
		int HERO_CARD = 6;

		@B2Field(remark = "修炼点", def = "7")
		int PRACTICE_POINT = 7;

		@B2Field(remark = "体力", def = "8")
		int PHYSICAL = 8;

	}

	@B2Class(type = B2G.DATA, remark = "用户类型", constant = true)
	class UserType {
		@B2Field(remark = "玩家", def = "1")
		public int WJ = 1;

		@B2Field(remark = "NPC", def = "2")
		public int NPC = 2;

		@B2Field(remark = "GM", def = "3")
		public int GM = 3;
	}

	@B2Class(type = B2G.DATA, remark = "登录方式", constant = true)
	class LoginType {
		@B2Field(remark = "默认登录", def = "1")
		public int DEFAULT_LOGIN = 1;

		@B2Field(remark = "昵称登录", def = "2")
		public int NAME_LOGIN = 2;
	}

	@B2Class(type = B2G.DATA, remark = "聊天类型", constant = true)
	class ChatType {
		@B2Field(remark = "公聊", def = "1")
		public int GL = 1;

		@B2Field(remark = "私聊", def = "2")
		public int SL = 2;

		@B2Field(remark = "联盟聊天", def = "3")
		public int LMLT = 3;

		@B2Field(remark = "联盟申请", def = "4")
		public int LMSQ = 4;
	}

	@B2Class(type = B2G.DATA, remark = "死亡类型", constant = true)
	class DeathType {
		@B2Field(remark = "建筑", def = "1")
		public int Building = 1;

		@B2Field(remark = "兵", def = "2")
		public int Character = 2;
	}

	@B2Class(type = B2G.DATA, remark = "道具类型", constant = true)
	class PropsType {
		@B2Field(remark = "体力", def = "1")
		public int Energy = 1;

		@B2Field(remark = "改名", def = "2")
		public int Renamed = 2;

		@B2Field(remark = "精炼", def = "3")
		public int Refining = 3;

		@B2Field(remark = "刷新修炼", def = "4")
		public int RefreshPractice = 4;

		@B2Field(remark = "修炼几率", def = "5")
		public int PracticeProbability = 5;

		@B2Field(remark = "竞技场次数", def = "6")
		public int ArenaCount = 6;

		@B2Field(remark = "宝箱", def = "7")
		public int Chest = 7;

		@B2Field(remark = "钥匙", def = "8")
		public int Key = 8;

		@B2Field(remark = "礼包", def = "9")
		public int Packs = 9;
	}

	@B2Class(type = B2G.DATA, remark = "获得内容类型", constant = true)
	class ItemType {
		@B2Field(remark = "金币", def = "1")
		public int Gold = 1;

		@B2Field(remark = "油", def = "2")
		public int Oil = 2;

		@B2Field(remark = "钻石", def = "3")
		public int Diamonds = 3;

		@B2Field(remark = "体力", def = "4")
		public int Strong = 4;

		@B2Field(remark = "玩家经验", def = "5")
		public int Player_Experience = 5;

		@B2Field(remark = "修炼点", def = "6")
		public int Training_Point = 6;

		@B2Field(remark = "道具", def = "7")
		public int Prop = 7;

		@B2Field(remark = "英雄卡", def = "8")
		public int Hero_Card = 8;

		@B2Field(remark = "改名", def = "9")
		public int Rename = 9;

		@B2Field(remark = "修炼收益倍数", def = "10")
		public int Practice_More = 10;

		@B2Field(remark = "刷新修炼内容", def = "11")
		public int Refresh_Training = 11;

		@B2Field(remark = "增加修炼成功率", def = "12")
		public int Cultivation_Probability = 12;

		@B2Field(remark = "恢复竞技场挑战次数", def = "13")
		public int Challenging_Times = 13;
	}

	@B2Class(type = B2G.DATA, remark = "英雄锁定", constant = true)
	class LockingHeroType {
		@B2Field(remark = "加锁", def = "1")
		public int Locking = 1;

		@B2Field(remark = "解锁", def = "2")
		public int NoLocking = 2;
	}

	@B2Class(type = B2G.DATA, remark = "充值状态", constant = true)
	class PaymentStat {
		@B2Field(remark = "错误", def = "-2")
		int ERROR = -2;

		@B2Field(remark = "失败", def = "-1")
		int FAILURE = -1;

		@B2Field(remark = "等待", def = "0")
		int WAITTING = 0;

		@B2Field(remark = "成功", def = "1")
		int SUCCESS = 1;
	}

	@B2Class(type = B2G.DATA, remark = "主城限制类型", constant = true)
	class TownHallType {
		@B2Field(remark = "建筑", def = "buildings")
		public String buildings = "buildings";

		@B2Field(remark = "障碍", def = "obstacles")
		public String obstacles = "obstacles";

		@B2Field(remark = "装饰", def = "decos")
		public String decos = "decos";

		@B2Field(remark = "建筑", def = "traps")
		public String traps = "traps";

		@B2Field(remark = "寻敌花费", def = "AttackCost")
		public String AttackCost = "AttackCost";
	}

	@B2Class(type = B2G.DATA, remark = "酒馆类型", constant = true)
	class TavernType {
		@B2Field(remark = "十里挑一", def = "slty")
		public String SLTY = "slty";

		@B2Field(remark = "百里挑一", def = "blty")
		public String BLTY = "blty";

		@B2Field(remark = "万里挑一", def = "wlty")
		public String WLTY = "wlty";
	}

	@B2Class(type = B2G.DATA, remark = "邮件类型", constant = true)
	class MailType {
		@B2Field(remark = "系统邮件", def = "1")
		public int SYSTEM = 1;

		@B2Field(remark = "普通邮件", def = "2")
		public int GENERAL = 2;
	}

	@B2Class(type = B2G.DATA, remark = "成就类型", constant = true)
	class AchievementType {
		// 状态(0:未开启 1:开启未完成 2:开启已完成 3:完成已领取)
		@B2Field(remark = "未开启", def = "0")
		public int UN_OPEN = 0;

		@B2Field(remark = "开启未完成", def = "1")
		public int OPEN = 1;

		@B2Field(remark = "开启已完成", def = "2")
		public int FINISH = 2;

		@B2Field(remark = "完成已领取成", def = "3")
		public int GOT = 3;
	}

	// --------------------------网络传输对象------------------------
	@B2Class(type = DATA, remark = "用户对象")
	class NUser {
		public NUserInfo userInfo;
		public List<NBuilding> buildings;
		public List<NObstacle> obstacles;
		public List<NDeco> decos;
		public List<NTrap> traps;
		public List<NHero> heros;
		public List<NBuildingFactory> buildingFactorys;
		public List<NObstacleFactory> obstacleFactorys;
		public List<NUserBackpack> userBackpacks;
		public List<NDuplicateInfo> duplicateInfos;
	}

	@B2Class(type = DATA, remark = "聊天信息集")
	class NChatInfos {
		public List<NChatInfo> chatInfos;
	}

	@B2Class(type = DATA, remark = "聊天信息")
	class NChatInfo {
		public int id;
		public String content;
		public int userId;
		public String userName;
		public int chatType;
	}

	@B2Class(type = DATA, remark = "邮件信息集")
	class NMailInfos {
		public List<NMailInfo> mailInfos;
		public int pageCount;
	}

	@B2Class(type = DATA, remark = "邮件信息")
	class NMailInfo {
		public int id;
		public String title;
		public String content;
		public int userId;
		public String userName;
		public int mailType;
		public boolean isRead;
	}

	@B2Class(type = DATA, remark = "Gid")
	class GidObject {
		public String code;
	}

	@B2Class(type = DATA, remark = "用户信息")
	class NUserInfo {
		public int id;
		public int sessionId;
		public String Name;
		public long systemTime;
		public int gold;
		public int water;
		public int diamond;
		public int lvl;
		public int lvlExp;
		public int vip;
		public int vipExp;
		public String language;
		public int newUserTaskIndex;
		public String gid;
		public long lastSltyTime;
		public long lastBltyTime;
		public long lastWltyTime;
		public int sltyCount;
		public int bltyCount;
		public int wltyCount;
		public long lastFreeSiphonSkillTime;
		public int freeSiphonSkillCount;
		public long lastUpdateObstacleTime;
		public long protectTime;
		public long lastIsAttackTime;
		public boolean shield_Chat;
		public boolean shield_Mail;
		public boolean shield_Login;
		public boolean shield_Device;
		public int energy; // 体力
		public int openDuplicateId;// 打开的NPC
		public int buyCardCount;// 购买的卡包数

		public long plunderGold;// 掠夺金币
		public long plunderWater;// 掠夺的水
		public long clearObstacleCount;// 清除的障碍数
		public long buyDiamond;// 购买的宝石数
		public long conquerUserCount;// 战胜玩家次数
		public long skillUpCount;// 技能升级次数
		public long loginDayCount;// 累计登录天数

		public long oneDayShieldTime;
		public long twoDayShieldTime;
		public long oneWeekShieldTime;

		public int practice_Point;// 修炼点
		public long updateEnergyTime;// 更新体力时间

		public String range;// 出兵范围信息
	}

	@B2Class(type = DATA, remark = "宝箱内容")
	class NChestObj {
		public int itemType;
		public int count;
		public NHero nhero;
		public NUserBackpack nUserBackpack;
	}

	@B2Class(type = DATA, remark = "建筑")
	class NBuilding {
		public int id;
		public int buildingKey;
		public int gid;
		public int x;
		public int y;
		public int lvl;
		public long lastGatherTime;// 最后收取时间
		public long lastUpTime;// 最后升级时间
		public long beginAccelerateTime;// 开始加速时间
		public long endAccelerateTime;// 结束加速时间
		public boolean damage;// 损坏
	}

	@B2Class(type = DATA, remark = "进攻英雄列表")
	class NAttackHeros {
		List<NBuilding> buildings;
		List<NHero> heros;
	}

	@B2Class(type = DATA, remark = "障碍")
	class NObstacle {
		public int id;
		public int obstacleKey;
		public int gid;
		public int x;
		public int y;
	}

	@B2Class(type = DATA, remark = "装饰")
	class NDeco {
		public int id;
		public int decoKey;
		public int gid;
		public int x;
		public int y;
	}

	@B2Class(type = DATA, remark = "陷阱")
	class NTrap {
		public int id;
		public int trapKey;
		public int gid;
		public int x;
		public int y;
	}

	@B2Class(type = DATA, remark = "英雄列表")
	class NHeros {
		List<NHero> nheros;
	}

	@B2Class(type = DATA, remark = "英雄")
	class NHero {
		public int id;
		public int heroKey;
		public int gid;
		public int lvl;
		public int exp;
		public int buildingId;
		public int buildingKey;
		public boolean isGarrison;// 是否防御
		public boolean isAutomatic;// 是否自动招兵
		public boolean isLocking;// 是否锁定
		public int practiceAttack;// 修炼攻击加成
		public int practicePh;// 修炼防御加成
		public int practiceProbability;// 修炼成功率
		public long lastPracticeDate;// 最后修炼时间
		public List<NSkill> skills;
		public List<NCharacterFactory> characterFactorys;
		// 兵数
		public int characterCount;
	}

	@B2Class(type = DATA, remark = "造兵队列")
	class NCharacterFactory {
		int id;
		int characterFactoryKey;
		int heroId;
		int heroKey;
		int count;
		long beginTime;
		long updateTime;
		long endTime;
	}

	@B2Class(type = DATA, remark = "建筑队列")
	class NBuildingFactory {
		int id;
		int buildingFactoryKey;
		int buildingId;
		int buildingKey;
		long beginTime;
		long endTime;
	}

	@B2Class(type = DATA, remark = "障碍队列")
	class NObstacleFactory {
		int id;
		int obstacleFactoryKey;
		int obstacleId;
		int obstacleKey;
		long beginTime;
		long endTime;
	}

	@B2Class(type = DATA, remark = "用户背包列表")
	class NUserBackpacks {
		List<NUserBackpack> nuserBackpacks;
	}

	@B2Class(type = DATA, remark = "用户背包")
	class NUserBackpack {
		int id;
		int propsId;
		int count;
	}

	@B2Class(type = DATA, remark = "技能")
	class NSkill {
		public int id;
		public int gid;
		public int lvl;
		public int location;
	}

	@B2Class(type = DATA, remark = "心跳信息列表")
	class NHeartbeat {
		public int code;
	}

	@B2Class(type = DATA, remark = "心跳信息")
	class NHeartbeats {
		public List<NHeartbeat> nHeartbeats;
	}

	@B2Class(type = DATA, remark = "数字信息")
	class NInt {
		public int num;
	}

	@B2Class(type = DATA, remark = "字符信息")
	class NStr {
		public String str;
	}

	@B2Class(type = DATA, remark = "布尔信息")
	class NBool {
		public boolean b;
	}

	@B2Class(type = DATA, remark = "修炼选项")
	class NPracticeUnit {
		int id;
		int gid;
		boolean can;
	}

	@B2Class(type = DATA, remark = "修炼选项列表")
	class NPracticeUnits {
		List<NPracticeUnit> practiceUnits;
	}

	@B2Class(type = DATA, remark = "战斗单位")
	class NAttatkUnit {
		int heroId;
		int time;
		double x;
		double y;
	}

	@B2Class(type = DATA, remark = "战斗单位列表")
	class NAttatkUnits {
		List<NAttatkUnit> nattatkUnits;
	}

	@B2Class(type = DATA, remark = "使用技能信息")
	class NUseSkill {
		int heroId;
		int skillIndex;
		double x;
		double y;
	}

	@B2Class(type = DATA, remark = "使用技能信息列表")
	class NUseSkills {
		List<NUseSkill> nuseSkills;
	}

	@B2Class(type = DATA, remark = "战斗信息")
	class NAttatcInfo {
		int characterId;
		int count;
	}

	@B2Class(type = DATA, remark = "战报信息")
	class NBattlefield {
		int id;
		int star;
		long beginTime;
		int gold;
		int elixir;
		String attackName;
		long attackTime;
		boolean canCounterattack;
		int combatPoints;
		List<NAttatcInfo> nattatcInfos;
	}

	@B2Class(type = DATA, remark = "战报信息列表")
	class NBattlefields {
		List<NBattlefield> nbattlefields;
	}

	@B2Class(type = DATA, remark = "副本信息")
	class NDuplicateInfo {
		int id;
		int star;
		int attackCount;
		long lastAttackTime;
	}

	@B2Class(type = DATA, remark = "副本信息列表")
	class NDuplicateInfos {
		List<NDuplicateInfo> nduplicateInfos;
	}

	@B2Class(type = DATA, remark = "个人排名")
	class NTopUser {
		int uid;
		String userName;
		int allianceId;
		String allianceName;
		int combat;
		int index;
		int historyIndex;
		String icon;
		int maxHeroId;
	}

	@B2Class(type = DATA, remark = "个人排名列表")
	class NTopUsers {
		List<NTopUser> topUsers;
	}

	@B2Class(type = DATA, remark = "联盟排行")
	class NTopAlliance {
		int allianceId;
		String allianceName;
		String icon;
		int combat;
		int index;
		int historyIndex;
		int nowPeople;
		int maxPeople;
	}

	@B2Class(type = DATA, remark = "联盟排行列表")
	class NTopAlliances {
		List<NTopAlliance> topAlliances;
	}

	@B2Class(type = DATA, remark = "竞技场信息")
	class NAthleticsInfo {
		int rank;
		int practicePoint;
		int practiceExp;
		int thisDayCount;
		List<NAthleticsUser> athleticsUsers;
	}

	@B2Class(type = DATA, remark = "竞技场用户")
	class NAthleticsUser {
		int uid;
		int maxHeroId;
		int exp;
		String userName;
		int allianceId;
		String allianceName;
		int top;
	}

	@B2Class(type = DATA, remark = "竞技场用户列表")
	class NAthleticsUsers {
		List<NAthleticsUser> nathleticsUsers;
	}

	@B2Class(type = DATA, remark = "成就")
	class NAchievement {
		int id;
		int gid;
		int stat; // AchievementType
		int actionNum; // 完成度(对应 ActionCount 任务需要数目)
	}

	@B2Class(type = DATA, remark = "成就s")
	class NAchievements {
		List<NAchievement> achs;
	}

	@B2Class(type = DATA, remark = "用户任务")
	class NUserTask {
		int id;
		int taskId;
		int uid;
	}

	@B2Class(type = DATA, remark = "用户任务列表")
	class NUserTasks {
		List<NUserTask> userTasks;
	}

	@B2Class(type = DATA, remark = "充值订单")
	class NOrder {
		public int id;
		public String goods;
		public int diamond;
		public String dat;
		public int stat; // -1:失败 0:等待中 1:成功
	}

	@B2Class(type = DATA, remark = "充值订单")
	class NOrders {
		List<NOrder> orders;
	}

	@B2Class(type = DATA, remark = "联盟事件")
	class NAllianceEvent {
		public int type;
		public int uid;
		public long createTime;
	}

	@B2Class(type = DATA, remark = "联盟事件集")
	class NAllianceEvents {
		List<NAllianceEvent> allianceEvents;
	}

	/**
	 * @info 1.活动系统、充值系统 没做！
	 * @info 2.任务系统未完善
	 * @info 3.竞技场 + 战斗 + 战斗回放 + 聊天 + 邮件 + 联盟 + 道具 待测试
	 * @info 4.同步消息系统未测试
	 */
	@B2Class(type = SERVER)
	interface GameServiceI {
		// ///////////////////////////////服务器端实现///////////////////////////////////
		/** -------------- 用户操作 -------------- */
		@B2Method(type = SERVER, params = {"device", "deviceSystem",
				"deviceCode", "fbl", "language", "card", "pass", "version",
				"channel", "serverId", "loginType", "nUser"}, remark = "登陆")
		ReturnStatus login(String device, String deviceSystem,
				String deviceCode, String fbl, String language, String card,
				String pass, String version, String channel, int serverId,
				int loginType,
				@B2Param(oType = "NUser", isOut = true) NUser nUser);

		// @B2Method(type = SERVER, params = { "info", "context" }, remark =
		// "测试BUF")
		// ReturnStatus echo(OutBytes info,
		// @B2Param(oType = "OutBytes", isOut = true) OutBytes context);

		@B2Method(type = SERVER, params = {"nNHeartbeats"}, remark = "心跳")
		ReturnStatus heartbeat(
				@B2Param(oType = "NHeartbeats", isOut = true) NHeartbeats nNHeartbeats);

		@B2Method(type = SERVER, params = {"id", "key", "x", "y", "typeId"}, remark = "移动操作")
		ReturnStatus move(int id, int key, int x, int y, int typeId);

		@B2Method(type = SERVER, params = {"index"}, remark = "提交新手任务步奏")
		ReturnStatus submitNewTaskIndex(int index);

		@B2Method(type = SERVER, params = {"name", "pass"}, remark = "设置昵称密码")
		ReturnStatus setNameAndPass(String name, String pass);

		@B2Method(type = SERVER, params = {"porpsId", "name"}, remark = "修改昵称")
		ReturnStatus renamed(int porpsId, String name);

		@B2Method(type = SERVER, params = {"context", "uid", "allianceId",
				"allianceKey"}, remark = "发送聊天")
		ReturnStatus sendChat(String context, int uid, int allianceId,
				int allianceKey);

		@B2Method(type = SERVER, params = {"name", "pass", "channel",
				"serverId", "code"}, remark = "取得GUID")
		ReturnStatus getGuid(String name, String pass, String channel,
				int serverId,
				@B2Param(oType = "GidObject", isOut = true) GidObject code);

		@B2Method(type = SERVER, params = {"propsGid", "num"}, remark = "购买道具")
		ReturnStatus buyProps(int propsGid, int num);

		@B2Method(type = SERVER, params = {"propsId", "count"}, remark = "使用普通道具")
		ReturnStatus useGeneralProps(int propsId, int count);

		@B2Method(type = SERVER, params = {"heroId", "heroKey", "propsId"}, remark = "使用增加修炼成功率")
		ReturnStatus usePracticeProbability(int heroId, int heroKey, int propsId);

		@B2Method(type = SERVER, params = {"propsId", "count", "chestObj"}, remark = "使用宝箱道具")
		ReturnStatus openChest(int propsId, int count,
				@B2Param(oType = "NChestObj", isOut = true) NChestObj chestObj);

		@B2Method(type = SERVER, params = {"resourceType", "pertype",
				"diamondCount"}, remark = "购买资源")
		ReturnStatus buyResource(String resourceType, int pertype,
				int diamondCount);

		@B2Method(type = SERVER, params = {"languageType"}, remark = "设置语言")
		ReturnStatus setLanguage(String languageType);

		@B2Method(type = SERVER, params = {"shieldId"}, remark = "购买保护")
		ReturnStatus buyShield(int shieldId);

		@B2Method(type = SERVER, params = {"count"}, remark = "购买卡包")
		ReturnStatus buyCardBackPack(int count);

		@B2Method(type = SERVER, params = {"nuserTasks"}, remark = "用户任务")
		ReturnStatus getUserTasks(
				@B2Param(oType = "NUserTasks", isOut = true) NUserTasks nuserTasks);

		@B2Method(type = SERVER, params = {"taskId"}, remark = "完成任务")
		ReturnStatus completeTask(int taskId);

		@B2Method(type = SERVER, params = {"page", "pageCount", "nchatInfos"}, remark = "取得聊天列表")
		ReturnStatus getChats(
				int page,
				int pageCount,
				@B2Param(oType = "NChatInfos", isOut = true) NChatInfos nchatInfos);

		@B2Method(type = SERVER, params = {"page", "pageCount", "nmailInfos"}, remark = "取得邮件列表")
		ReturnStatus getMails(
				int page,
				int pageCount,
				@B2Param(oType = "NMailInfos", isOut = true) NMailInfos nmailInfos);

		@B2Method(type = SERVER, params = {"targetUserName", "title", "content"}, remark = "发送邮件")
		ReturnStatus sendMail(String targetUserName, String title,
				String content);

		@B2Method(type = SERVER, params = {"mailId"}, remark = "读取邮件")
		ReturnStatus readMail(int mailId);

		@B2Method(type = SERVER, params = {"mailId"}, remark = "收取附件")
		ReturnStatus chargeMailAttachment(int mailId);

		@B2Method(type = SERVER, params = {"mailId"}, remark = "删除邮件")
		ReturnStatus deleteMail(int mailId);

		/** -------------- 同步操作 -------------- */
		@B2Method(type = SERVER, params = {"nchatInfos"}, remark = "同步聊天")
		ReturnStatus syncChat(
				@B2Param(oType = "NChatInfos", isOut = true) NChatInfos nchatInfos);

		@B2Method(type = SERVER, params = {"nmailInfos"}, remark = "同步邮件")
		ReturnStatus syncMail(
				@B2Param(oType = "NMailInfos", isOut = true) NMailInfos nmailInfos);

		@B2Method(type = SERVER, params = {"nheros"}, remark = "同步英雄")
		ReturnStatus syncHero(
				@B2Param(oType = "NHeros", isOut = true) NHeros nheros);

		@B2Method(type = SERVER, params = {"nuserBackpacks"}, remark = "同步背包")
		ReturnStatus syncUserBackpack(
				@B2Param(oType = "NUserBackpacks", isOut = true) NUserBackpacks nuserBackpacks);

		@B2Method(type = SERVER, params = {"nuserInfo"}, remark = "同步用户基本信息")
		ReturnStatus syncUserInfo(
				@B2Param(oType = "NMailInfos", isOut = true) NUserInfo nuserInfo);

		@B2Method(type = SERVER, params = {"nuserInfo"}, remark = "同步用户副本信息")
		ReturnStatus syncDuplicateInfo(
				@B2Param(oType = "NDuplicateInfo", isOut = true) NDuplicateInfo nduplicateInfo);

		/** -------------- 英雄操作 -------------- */
		@B2Method(type = SERVER, params = {"heroId", "heroKey"}, remark = "选择初始英雄")
		ReturnStatus selectHero(int heroId, int heroKey);

		@B2Method(type = SERVER, params = {"heroId", "heroKey",
				"lockingHeroType"}, remark = "英雄锁定与解锁")
		ReturnStatus lockingHero(int heroId, int heroKey, int lockingHeroType);

		@B2Method(type = SERVER, params = {"siphonType", "isDiamond",
				"heroKey", "nhero"}, remark = "抽取英雄")
		ReturnStatus siphonHero(String siphonType, boolean isDiamond,
				int heroKey, @B2Param(oType = "NHero", isOut = true) NHero nhero);

		@B2Method(type = SERVER, params = {"mainHeroId", "mainHeroKey",
				"heros", "hero"}, remark = "英雄升级 hero:[{'heroId':xxx,'heroKey':xxx}]")
		ReturnStatus upHero(int mainHeroId, int mainHeroKey, String heros,
				@B2Param(oType = "NHero", isOut = true) NHero hero);

		@B2Method(type = SERVER, params = {"mainHeroId", "mainHeroKey",
				"deputyHeroId", "deputyHeroKey"}, remark = "英雄进化")
		ReturnStatus evolutionHero(int mainHeroId, int mainHeroKey,
				int deputyHeroId, int deputyHeroKey);

		@B2Method(type = SERVER, params = {"heroId", "heroKey", "isDiamond",
				"nSkill"}, remark = "抽取技能")
		ReturnStatus siphonSkill(int heroId, int heroKey, boolean isDiamond,
				@B2Param(oType = "NSkill", isOut = true) NSkill nSkill);

		@B2Method(type = SERVER, params = {"heroId", "heroKey"}, remark = "获得技能")
		ReturnStatus setSkill(int heroId, int heroKey);

		@B2Method(type = SERVER, params = {"heroId", "heroKey", "count"}, remark = "建造士兵")
		ReturnStatus buildCharacter(int heroId, int heroKey, int count);

		@B2Method(type = SERVER, params = {"heroId", "heroKey"}, remark = "刷新兵数")
		ReturnStatus refreshCharacter(int heroId, int heroKey);

		@B2Method(type = SERVER, params = {"heroId", "heroKey", "buildingId",
				"buildingKey"}, remark = "设置英雄状态")
		ReturnStatus setHeroStatus(int heroId, int heroKey, int buildingId,
				int buildingKey);

		@B2Method(type = SERVER, params = {"heroId", "heroKey"}, remark = "宝石建造兵")
		ReturnStatus atOncebuildCharacter(int heroId, int heroKey);

		@B2Method(type = SERVER, params = {"heroId", "heroKey", "count"}, remark = "取消造兵")
		ReturnStatus cancelbuildCharacter(int heroId, int heroKey, int count);

		@B2Method(type = SERVER, params = {"heroId", "heroKey", "practiceId",
				"propsId", "npracticeUnits", "nbool"}, remark = "执行修炼")
		ReturnStatus practiceHero(
				int heroId,
				int heroKey,
				int practiceId,
				int propsId,
				@B2Param(oType = "NPracticeUnits", isOut = true) NPracticeUnits npracticeUnits,
				@B2Param(oType = "NBool", isOut = true) NBool nbool);

		@B2Method(type = SERVER, params = {"propsId", "npracticeUnits"}, remark = "道具刷新修炼")
		ReturnStatus propsRefreshPractice(
				int propsId,
				@B2Param(oType = "NPracticeUnits", isOut = true) NPracticeUnits npracticeUnits);

		@B2Method(type = SERVER, params = {"heroId", "heroKey",
				"npracticeUnits"}, remark = "Open修炼")
		ReturnStatus practice(
				@B2Param(oType = "NPracticeUnits", isOut = true) NPracticeUnits npracticeUnits);

		@B2Method(type = SERVER, params = {"heroId", "heroKey", "isGarrison"}, remark = "驻防")
		ReturnStatus heroGarrison(int heroId, int heroKey, boolean isGarrison);

		/** -------------- 战斗操作 -------------- */
		@B2Method(type = SERVER, params = {"targertId", "targertName",
				"targertType", "targetUser"}, remark = "搜寻玩家")
		ReturnStatus searchEnemy(int targertId, String targertName,
				int targertType,
				@B2Param(oType = "NUser", isOut = true) NUser targetUser);

		@B2Method(type = SERVER, params = {"reportId", "targetUser"}, remark = "反击")
		ReturnStatus counterattack(int reportId,
				@B2Param(oType = "NUser", isOut = true) NUser targetUser);

		@B2Method(type = SERVER, params = {"reportKey", "targetId", "beginTime"}, remark = "开始战斗")
		ReturnStatus beginFight(int reportKey, int targetId, long beginTime);

		@B2Method(type = SERVER, params = {"reportKey", "heros"}, remark = "结束战斗")
		ReturnStatus endFight(int reportKey,
				@B2Param(oType = "NHeros", isOut = true) NHeros heros);

		@B2Method(type = SERVER, params = {"reportKey", "star"}, remark = "设置战斗星数")
		ReturnStatus setFightStar(int reportKey, int star);

		@B2Method(type = SERVER, params = {"reportKey", "heroId", "heroKey",
				"count", "x", "y", "time"}, remark = "设置攻击单位")
		ReturnStatus setAttackUnit(int reportKey, int heroId, int heroKey,
				int count, double x, double y, double time);

		@B2Method(type = SERVER, params = {"reportKey", "resourceType",
				"resourceCount"}, remark = "掠夺资源")
		ReturnStatus plunderResource(int reportKey, String resourceType,
				int resourceCount);

		@B2Method(type = SERVER, params = {"reportKey", "heroId", "heroKey",
				"buildingId", "count", "camp", "DeathType"}, remark = "战斗单位死亡")
		ReturnStatus attackUnitDeath(int reportKey, int heroId, int heroKey,
				int buildingId, int count, int camp, int deathType);

		@B2Method(type = SERVER, params = {"reportKey", "x", "y"}, remark = "生成墓碑")
		ReturnStatus generateTombstone(int reportKey, int x, int y);

		@B2Method(type = SERVER, params = {"reportKey", "trapId"}, remark = "触发陷阱")
		ReturnStatus triggerTrap(int reportKey, int trapId);

		@B2Method(type = SERVER, params = {"reportKey", "heroId", "heroKey",
				"skillIndex", "x", "y", "time"}, remark = "使用英雄技能")
		ReturnStatus useHeroSkill(int reportKey, int heroId, int heroKey,
				int skillIndex, double x, double y, double time);

		@B2Method(type = SERVER, params = {"reportId", "nattatkUnits", "nuser",
				"nbattlefield", "nuseSkills", "nattackHeros"}, remark = "查看战报")
		ReturnStatus getBattlefield(
				int reportKey,
				@B2Param(oType = "NAttatkUnits", isOut = true) NAttatkUnits nattatkUnits,
				@B2Param(oType = "NUser", isOut = true) NUser nuser,
				@B2Param(oType = "NBattlefield", isOut = true) NBattlefield nbattlefield,
				@B2Param(oType = "NUseSkills", isOut = true) NUseSkills nuseSkills,
				@B2Param(oType = "NAttackHeros", isOut = true) NAttackHeros nattackHeros);

		@B2Method(type = SERVER, params = {"page", "pageSize", "nbattlefields"}, remark = "取得战报列表")
		ReturnStatus getBattlefieldArray(
				int page,
				int pageSize,
				@B2Param(oType = "NBattlefields", isOut = true) NBattlefields nbattlefields);

		/** -------------- 建筑操作 -------------- */

		@B2Method(type = SERVER, params = {"buildingId", "buildingKey", "count"}, remark = "收取资源")
		ReturnStatus gatherResource(int buildingId, int buildingKey, int count);

		@B2Method(type = SERVER, params = {"buildingId", "buildingKey",
				"factoryKey", "diamondCount"}, remark = "升级建筑")
		ReturnStatus upgradeBuilding(int buildingId, int buildingKey,
				int factoryKey, int diamondCount);

		@B2Method(type = SERVER, params = {"gid", "x", "y", "buildingkey",
				"factoryKey", "diamondCount"}, remark = "新建建筑")
		ReturnStatus buyBuilding(int gid, int x, int y, int buildingkey,
				int factoryKey, int diamondCount);

		@B2Method(type = SERVER, params = {"factoryId", "factorykey"}, remark = "取消升级建筑")
		ReturnStatus cancelUpgradeBuilding(int factoryId, int factorykey);

		@B2Method(type = SERVER, params = {"factoryId", "factorykey"}, remark = "立刻完成建筑建造")
		ReturnStatus atOnceUpgradeBuilding(int factoryId, int factorykey);

		@B2Method(type = SERVER, params = {"factoryId", "factorykey"}, remark = "拆除建筑")
		ReturnStatus deleteBuilding(int factoryId, int factorykey);

		@B2Method(type = SERVER, params = {"factoryId", "factorykey"}, remark = "建造完成")
		ReturnStatus buildComplete(int factoryId, int factorykey);

		/** -------------- 障碍操作 -------------- */
		@B2Method(type = SERVER, params = {"obstacleId", "obstacleKey",
				"factoryKey", "diamondCount"}, remark = "消除障碍")
		ReturnStatus clearObstacle(int obstacleId, int obstacleKey,
				int factoryKey, int diamondCount);

		@B2Method(type = SERVER, params = {"gid", "x", "y", "obstacleKey"}, remark = "添加障碍")
		ReturnStatus addObstacle(int gid, int x, int y, int obstacleKey);

		@B2Method(type = SERVER, params = {"factoryId", "factoryKey"}, remark = "完成消除")
		ReturnStatus clearComplete(int factoryId, int factoryKey);

		@B2Method(type = SERVER, params = {"factoryId", "factoryKey"}, remark = "取消消除")
		ReturnStatus cancelClear(int factoryId, int factoryKey);

		@B2Method(type = SERVER, params = {"factoryId", "factoryKey"}, remark = "宝石消除")
		ReturnStatus atOnceClear(int factoryId, int factoryKey);

		/** -------------- 装饰操作 -------------- */
		@B2Method(type = SERVER, params = {"gid", "x", "y", "decoKey",
				"diamondCount"}, remark = "购买装饰")
		ReturnStatus buyDeco(int gid, int x, int y, int decoKey,
				int diamondCount);

		@B2Method(type = SERVER, params = {"id", "decoKey"}, remark = "拆除装饰")
		ReturnStatus deleteDeco(int id, int decoKey);

		/** -------------- 陷阱操作 -------------- */
		@B2Method(type = SERVER, params = {"gid", "x", "y", "trapKey",
				"diamondCount"}, remark = "购买陷阱")
		ReturnStatus buyTrap(int gid, int x, int y, int trapKey,
				int diamondCount);

		@B2Method(type = SERVER, params = {"id", "trapKey"}, remark = "拆除陷阱")
		ReturnStatus deleteTrap(int id, int trapKey);

		/** -------------- 查看操作 -------------- */
		@B2Method(type = SERVER, params = {"id"}, remark = "取得NPC城市")
		ReturnStatus getNpcCity(int id);

		@B2Method(type = SERVER, params = {"name", "type"}, remark = "取得玩家城市")
		ReturnStatus getNpcUser(String name, int type);

		/** -------------- 排行榜 -------------- */
		@B2Method(type = SERVER, params = {"page", "size", "ntopUsers"}, remark = "个人排行")
		ReturnStatus topUsers(int page, int size,
				@B2Param(oType = "NTopUsers", isOut = true) NTopUsers ntopUsers);

		@B2Method(type = SERVER, params = {"page", "size", "ntopAlliances"}, remark = "联盟排行")
		ReturnStatus topAlliances(
				int page,
				int size,
				@B2Param(oType = "NTopAlliances", isOut = true) NTopAlliances ntopAlliances);

		@B2Method(type = SERVER, params = {"page", "size", "ntopUsers"}, remark = "竞技排行")
		ReturnStatus topAthleticss(int page, int size,
				@B2Param(oType = "NTopUsers", isOut = true) NTopUsers ntopUsers);

		/** -------------- 竞技场 -------------- */
		@B2Method(type = SERVER, params = {"nathleticsInfo"}, remark = "打开竞技场")
		ReturnStatus openAthletics(
				@B2Param(oType = "NAthleticsInfo", isOut = true) NAthleticsInfo nathleticsInfo);

		@B2Method(type = SERVER, params = {"nathleticsUsers"}, remark = "刷新竞技场")
		ReturnStatus refreshAthletics(
				@B2Param(oType = "NAthleticsUsers", isOut = true) NAthleticsUsers nathleticsUsers);

		@B2Method(type = SERVER, params = {"challengeKey", "targetId"}, remark = "开始挑战")
		ReturnStatus BeginChallenge(int challengeKey, int targetId);

		@B2Method(type = SERVER, params = {"challengeKey", "isVictory"}, remark = "结束挑战")
		ReturnStatus endChallenge(int challengeKey, boolean isVictory);

		@B2Method(type = SERVER, params = {}, remark = "领奖")
		ReturnStatus challengeAward();

		/** -------------- 联盟 -------------- */
		@B2Method(type = SERVER, params = {"tempid", "allianceName", "icon"}, remark = "创建联盟")
		ReturnStatus createAlliance(int tempid, String allianceName, String icon);

		@B2Method(type = SERVER, params = {"allianceId"}, remark = "申请加入")
		ReturnStatus sendJoinAlliance(int allianceId);

		@B2Method(type = SERVER, params = {"allianceId"}, remark = "退出联盟")
		ReturnStatus exitAlliance(int allianceId);

		@B2Method(type = SERVER, params = {"yhid"}, remark = "踢出联盟")
		ReturnStatus kickedOutAlliance(int yhid);

		@B2Method(type = SERVER, params = {}, remark = "解散联盟")
		ReturnStatus dissolveAlliance();

		@B2Method(type = SERVER, params = {"eventType", "allianceEventId"}, remark = "处理联盟申请")
		ReturnStatus processRequest(int eventType, int allianceEventId);

		@B2Method(type = SERVER, params = {"page", "pageSize", "eventType",
				"allianceEvents"}, remark = "取得联盟事件列表")
		ReturnStatus getAllianceEvents(
				int page,
				int pageSize,
				int eventType,
				@B2Param(oType = "NAllianceEvents", isOut = true) NAllianceEvents allianceEvents);

		/** -------------- 任务 -------------- */

		/** -------------- 充值 -------------- */
		@B2Method(type = SERVER, params = {"chnMz", "tmpKey", "goods", "rmb",
				"diamond"}, remark = "创建订单")
		ReturnStatus createOrder(String chnMz, String tmpKey, String goods,
				int diamond);

		@B2Method(type = SERVER, params = {"succ", "page", "pageSize", "orders"}, remark = "获得订单s")
		ReturnStatus getOrders(boolean succ, int page, int pageSize,
				@B2Param(oType = "NOrders", isOut = true) NOrders orders);

		@B2Method(type = SERVER, params = {"id", "orders"}, remark = "获得订单")
		ReturnStatus findOrder(int id,
				@B2Param(oType = "NOrders", isOut = true) NOrders orders);

	}

	// ///////////////////////////////////////////////////

}
